(self.webpackChunkCE2=self.webpackChunkCE2||[]).push([[806,60],{9880:(e,t,s)=>{"use strict";s.r(t),s.d(t,{AssetTracker:()=>mt,EventHandlers:()=>ft,compress:()=>X,timing:()=>a});var r=s(4933),i=s(884),n=s(4794);const o=function(){this.metrics={}};o.prototype={start(e){this.metrics[e]=+new Date},stop(e){const t=this.metrics[e];if(!t)return void(0,i.Yz)(`[TimingMetric] No starting point for "${e}", ignoring.`);const s=+new Date-t;this.cancel(e),this.send(e,s)},cancel(e){delete this.metrics[e]},send(e,t){if(e.length>100)throw new Error("Key is too long (max 100)");if((t=Number(t,10))&&Number.isNaN(Number(t)))throw new Error("Value is NaN");if(!CE2.site)return void(0,i.Yz)(`[TimingMetric] No site, skipping metric ${e}`);const s=[[(0,n.M4)(0,1),CE2.tracker?.visitorID,25,CE2.VERSION,+new Date,CE2.tabId],[CE2.tracker?.visitID,e,t||"",CE2.visitorTracker?.getIdentification()]];(0,r.sendEvents)({context:"TimingMetric",userId:CE2.data.uid,siteId:CE2.site.id,snapshotIds:CE2.tracker?.snapshotIds,sessionId:CE2.tracker?.sessionId,pageFingerprintMd5:CE2.tracker?.pageFingerprintMd5},[s]),(0,i.Yz)(`[TimingMetric] Sent key=${e} value=${t}`)},getTrackerValue(e){if(CE2.tracker)return CE2.tracker[e]}};const a=new o;var c=Uint8Array,l=Uint16Array,h=Int32Array,u=new c([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new c([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),p=new c([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m=function(e,t){for(var s=new l(31),r=0;r<31;++r)s[r]=t+=1<>1|(21845&w)<<1;b=(61680&(b=(52428&b)>>2|(13107&b)<<2))>>4|(3855&b)<<4,y[w]=((65280&b)>>8|(255&b)<<8)>>1}var k=function(e,t,s){for(var r=e.length,i=0,n=new l(t);i>c]=h}else for(o=new l(r),i=0;i>15-e[i]);return o},T=new c(288);for(w=0;w<144;++w)T[w]=8;for(w=144;w<256;++w)T[w]=9;for(w=256;w<280;++w)T[w]=7;for(w=280;w<288;++w)T[w]=8;var S=new c(32);for(w=0;w<32;++w)S[w]=5;var _=k(T,9,0),A=k(S,5,0),I=function(e){return(e+7)/8|0},O=function(e,t,s){return(null==t||t<0)&&(t=0),(null==s||s>e.length)&&(s=e.length),new c(e.subarray(t,s))},N=function(e,t,s){s<<=7&t;var r=t/8|0;e[r]|=s,e[r+1]|=s>>8},R=function(e,t,s){s<<=7&t;var r=t/8|0;e[r]|=s,e[r+1]|=s>>8,e[r+2]|=s>>16},L=function(e,t){for(var s=[],r=0;rm&&(m=n[r].s);var f=new l(m+1),E=M(s[d-1],f,0);if(E>t){r=0;var g=0,v=E-t,C=1<t))break;g+=C-(1<>=v;g>0;){var w=n[r].s;f[w]=0&&g;--r){var b=n[r].s;f[b]==t&&(--f[b],++g)}E=t}return{t:new c(f),l:E}},M=function(e,t,s){return-1==e.s?Math.max(M(e.l,t,s+1),M(e.r,t,s+1)):t[e.s]=s},P=function(e){for(var t=e.length;t&&!e[--t];);for(var s=new l(++t),r=0,i=e[0],n=1,o=function(e){s[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++n;else{if(!i&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(i),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(i);n=1,i=e[a]}return{c:s.subarray(0,r),n:t}},D=function(e,t){for(var s=0,r=0;r>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var n=0;n4&&!V[p[q-1]];--q);var G,K,W,z,Y=h+5<<3,j=D(i,T)+D(n,S)+o,Q=D(i,E)+D(n,C)+o+14+3*q+D(U,V)+2*U[16]+3*U[17]+7*U[18];if(c>=0&&Y<=j&&Y<=Q)return B(t,m,e.subarray(c,c+h));if(N(t,m,1+(Q15&&(N(t,m,ee[F]>>5&127),m+=ee[F]>>12)}}}else G=_,K=T,W=A,z=S;for(F=0;F255){R(t,m,G[(te=se>>18&31)+257]),m+=K[te+257],te>7&&(N(t,m,se>>23&31),m+=u[te]);var re=31&se;R(t,m,W[re]),m+=z[re],re>3&&(R(t,m,se>>5&8191),m+=d[re])}else R(t,m,G[se]),m+=K[se]}return R(t,m,G[256]),m+K[256]},U=new h([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new c(0),H=function(e,t,s,r,i,n){var o=n.z||e.length,a=new c(r+o+5*(1+Math.ceil(o/7e3))+i),p=a.subarray(r,a.length-i),m=n.l,f=7&(n.r||0);if(t){f&&(p[0]=n.r>>3);for(var E=U[t-1],v=E>>13,y=8191&E,w=(1<7e3||D>24576)&&(G>423||!m)){f=x(e,p,0,A,N,R,M,D,H,P-H,f),D=L=M=0,H=P;for(var K=0;K<286;++K)N[K]=0;for(K=0;K<30;++K)R[K]=0}var W=2,z=0,Y=y,j=$-q&32767;if(G>2&&V==_(P-j))for(var Q=Math.min(v,G)-1,X=Math.min(32767,P),J=Math.min(258,G);j<=X&&--Y&&$!=q;){if(e[P+W]==e[P+W-j]){for(var Z=0;ZW){if(W=Z,z=j,Z>Q)break;var ee=Math.min(j,Z-2),te=0;for(K=0;Kte&&(te=re,q=se)}}}j+=($=q)-(q=b[$])&32767}if(z){A[D++]=268435456|g[W]<<18|C[z];var ie=31&g[W],ne=31&C[z];M+=u[ie]+d[ne],++N[257+ie],++R[ne],F=P+W,++L}else A[D++]=e[P],++N[e[P]]}}for(P=Math.max(P,F);P=o&&(p[f/8|0]=m,oe=o),f=B(p,f+1,e.subarray(P,oe))}n.i=o}return O(a,0,r+I(f)+i)},V=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var s=t,r=9;--r;)s=(1&s&&-306674912)^s>>>1;e[t]=s}return e}(),$=function(){var e=-1;return{p:function(t){for(var s=e,r=0;r>>8;e=s},d:function(){return~e}}},q=function(e,t,s,r,i){if(!i&&(i={l:1},t.dictionary)){var n=t.dictionary.subarray(-32768),o=new c(n.length+e.length);o.set(n),o.set(e,n.length),e=o,i.w=n.length}return H(e,null==t.level?6:t.level,null==t.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,s,r,i)},G=function(e,t,s){for(;s;++t)e[t]=s,s>>>=8},K=function(e,t){var s=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&G(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),s){e[3]=8;for(var r=0;r<=s.length;++r)e[r+10]=s.charCodeAt(r)}},W=function(e){return 10+(e.filename?e.filename.length+1:0)};function z(e,t){t||(t={});var s=$(),r=e.length;s.p(e);var i=q(e,t,W(t),8),n=i.length;return K(i,t),G(i,n-8,s.d()),G(i,n-4,r),i}var Y="undefined"!=typeof TextEncoder&&new TextEncoder,j="undefined"!=typeof TextDecoder&&new TextDecoder;try{j.decode(F,{stream:!0}),1}catch(e){}function Q(e,t){if(t){for(var s=new c(e.length),r=0;r>1)),o=0,a=function(e){n[o++]=e};for(r=0;rn.length){var l=new c(o+8+(i-r<<1));l.set(n),n=l}var h=e.charCodeAt(r);h<128||t?a(h):h<2048?(a(192|h>>6),a(128|63&h)):h>55295&&h<57344?(a(240|(h=65536+(1047552&h)|1023&e.charCodeAt(++r))>>18),a(128|h>>12&63),a(128|h>>6&63),a(128|63&h)):(a(224|h>>12),a(128|h>>6&63),a(128|63&h))}return O(n,0,o)}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;const X=e=>{if("string"==typeof e)return z(Q(e));if(!ArrayBuffer.isView(e))throw new Error("Data must be UInt* data type or string");return z(e)};var J=s(390);class Z{constructor(e){CE2BH.defineProperty(this,"CHECKOUT_STARTED_KEY","ceeccs"),CE2BH.defineProperty(this,"eventTypes",{ADD_TO_CART:1,CHECKOUT_STARTED:2,CHECKOUT_COMPLETED:3}),this.tracker=e,this.tracker.addEventListener("mousedown",(e=>{"l"===(0,J.CU)(e)&&this.onClick&&this.onClick(e)}))}static api(){return this.NAME.toLowerCase()}api(){return this.constructor.api()}setCheckoutStarted(){CE2.cookieStorage.set(this.CHECKOUT_STARTED_KEY,1)}getCheckoutStarted(){return"1"===CE2.cookieStorage.get(this.CHECKOUT_STARTED_KEY)}delCheckoutStarted(){CE2.cookieStorage.del(this.CHECKOUT_STARTED_KEY)}isCheckoutStarted(){return!this.getCheckoutStarted()&&this.CHECKOUT_STARTED_PATH_REGEXP&&this.CHECKOUT_STARTED_PATH_REGEXP.test(CE2.w.location.pathname)}isCheckoutCompleted(){return this.getCheckoutStarted()&&this.CHECKOUT_COMPLETED_PATH_REGEXP&&this.CHECKOUT_COMPLETED_PATH_REGEXP.test(CE2.w.location.pathname)}update(){this.isCheckoutStarted()&&this.startCheckout(),this.isCheckoutCompleted()&&this.checkoutCompleted()}startCheckout(){this.setCheckoutStarted(),this.sendCheckoutStartedEvent()}checkoutCompleted(e=[]){this.delCheckoutStarted(),this.sendCheckoutCompletedEvent(e)}sendCheckoutStartedEvent(){this.sendEvent([this.eventTypes.CHECKOUT_STARTED]),this.emitEvent("startCheckout")}sendCheckoutCompletedEvent(e=[]){this.sendEvent([this.eventTypes.CHECKOUT_COMPLETED,...e]);const[t,s,r]=e;this.tracker.session?.isFull()&&(s||0===s)&&CE2.setSessionWorth(s/1e4,r);let i={};(s||0===s)&&(i={value:s/1e4,currency:r}),this.emitEvent("checkoutCompleted",i)}addToCart(e){this.delCheckoutStarted(),this.sendEvent([this.eventTypes.ADD_TO_CART,...e]);const[t,s,r,i,n]=e;this.tracker.session?.isFull()&&(i||0===i)&&CE2.increaseSessionWorth(i/1e4,n);let o={};(i||0===i)&&(o={value:i/1e4,currency:n}),this.emitEvent("addToCart",o)}sendEvent(e=[]){if(!this.tracker.session?.isFull())return;e=[this.tracker.visitID,...e];const t=this.tracker.newEvent(CE2.eventTypes.ECOMMERCE,{attributes:e});this.tracker.send(t)}emitEvent(e,t={}){CE2.w.dispatchEvent(new CustomEvent(`crazyegg.${e}`,{detail:CE2BH.extends({type:e,api:this.constructor.api()},t)}))}amountInCents(e){return this.tracker.amountInCents(e)}}CE2BH.defineProperty(Z,"NAME","Base");class ee extends Z{}function te(e,...t){const s=1===t.length&&t[0].includes(".")?t[0].split("."):t;let r=e;for(let e=0;e{if(void 0===CE2.state._isFB){const e=CE2.n.userAgent;for(let t=0,s=["FBSN","FBAN","FBAV"];t-1){CE2.state._isFB=!0;break}}CE2.state._isFB||(CE2.state._isFB=!1)}return CE2.state._isFB};class ie extends Z{constructor(...e){super(...e),CE2BH.defineProperty(this,"CHECKOUT_STARTED_PATH_REGEXP",/\/checkout(s)?\//i),CE2BH.defineProperty(this,"CHECKOUT_COMPLETED_PATH_REGEXP",/\/checkout(s)?\/.*thank(_|-)?you/i)}onClick(e){const t=(0,J.wt)(e);if((0,J.B5)(t,'button[name=add], button[name=add] *, form[action="/cart/add"] button[type=submit], form[action="/cart/add"] button[type=submit] *')||(0,J.B5)(t,"button[type=submit]",!0)&&t.closest('form[action="/cart/add"]')||/^\s*(add to (cart|bag|basket)|buy now)\s*$/i.test(t.innerText||t.value)){let e=[];const t=CE2.w.ShopifyAnalytics?.meta;if(t?.currency&&t?.product?.variants?.length&&(t?.selectedVariantId||1===t?.product?.variants?.length)){const s=t.selectedVariantId,r=t?.product?.variants?.length>1&&s?t.product.variants.find((e=>e.id==s)):t.product.variants[0],i=parseInt(CE2.d.querySelector("input[name=quantity]")?.value,10)||1;e=[r.id,r.name,i,this.amountInCents(r.price/100)*i,t.currency]}this.addToCart(e)}}sendCheckoutCompletedEvent(){const e=CE2.w.Shopify&&CE2.w.Shopify.checkout||{},t=this.amountInCents(e.total_price&&e.total_price);super.sendCheckoutCompletedEvent([e.order_id,t,e.currency])}static match(){return CE2.w&&CE2.w.Shopify&&te(CE2.w,"ShopifyAnalytics.lib.integrations")}}CE2BH.defineProperty(ie,"NAME","Shopify");class ne extends Z{constructor(...e){super(...e),CE2BH.defineProperty(this,"CHECKOUT_STARTED_PATH_REGEXP",/\/checkout(s)?\//i),CE2BH.defineProperty(this,"CHECKOUT_COMPLETED_PATH_REGEXP",/\/checkout(s)?\/.*((thank(_|-)?you)|(order-received))/i)}onClick(e){const{target:t}=e;if((0,J.B5)(t,'.single_add_to_cart_button, [class*="add_to_cart"], [class*="add-to-cart"]')||/^\s*(add to (cart|bag|basket)|buy now)\s*$/i.test(t.innerText||t.value)){let e=[];const t=ne.getProduct();if(t)try{const s=CE2.d.querySelector("input.qty"),r=t.offers&&(t.offers[0]||t.offers);this.currency=r&&r.priceCurrency,e=[t.sku||t["@id"],t.name,s&&s.value,this.amountInCents(r&&(r.price||r.lowPrice||r.hightPrice)),r&&r.priceCurrency]}catch(e){(0,i.Yz)("error extracting product data",e)}this.addToCart(e)}}static getProduct(){for(let e=0,t=CE2.d.querySelectorAll('script[type="application/ld+json"]');e"Product"===e["@type"]));if(t)return t}}}catch(e){(0,i.Yz)("error extracting product data",e)}}}sendCheckoutCompletedEvent(){const e=CE2.d.querySelector(".order"),t=CE2.d.querySelector(".total");super.sendCheckoutCompletedEvent([ne.getValue(e&&e.innerText),this.amountInCents(ne.getValue(t&&t.innerText)),this.currency])}static getValue(e){return e&&(e.indexOf(":")>-1?e.split(":")[1].trim():e)}static match(){return CE2.w&&Object.keys(CE2.w).find((e=>/^wc_.*_params$/.test(e)))}}CE2BH.defineProperty(ne,"NAME","Woocommerce");class oe extends Z{constructor(...e){super(...e),CE2BH.defineProperty(this,"CHECKOUT_STARTED_PATH_REGEXP",/\/checkout(s)?\//i),CE2BH.defineProperty(this,"CHECKOUT_COMPLETED_PATH_REGEXP",/\/checkout(s)?\/.*success/i)}onClick(e){const{target:t}=e;if((0,J.B5)(t,'#product-addtocart-button, [class*="add_to_cart"], [class*="add-to-cart"]')||/^\s*(add to (cart|bag|basket)|buy now)\s*$/i.test(t.innerText||t.value)){let e=[];const s=oe.getProduct(t);this.currency=s.priceCurrency,s&&(e=[s.id,s.name,s.qty,this.amountInCents(s.price),s.priceCurrency]),this.addToCart(e)}}static getProduct(e){const t={};try{const s=e.closest(".product-info-main");t.name=CE2.d.querySelector(".page-title")&&CE2.d.querySelector(".page-title").innerText,t.qty=s.querySelector("input.qty")&&s.querySelector("input.qty").value,t.id=s.querySelector('input[name="product"]')&&s.querySelector('input[name="product"]').value,t.price=s.querySelector('[itemprop="price"]')&&(s.querySelector('[itemprop="price"]').getAttribute("content")||s.querySelector('[itemprop="price"]').innerText),t.priceCurrency=s.querySelector('[itemprop="priceCurrency"]')&&s.querySelector('[itemprop="priceCurrency"]').getAttribute("content")}catch(e){(0,i.Yz)("error extracting product data",e)}return t}sendCheckoutCompletedEvent(){const e=CE2.d.querySelector(".order-number"),t=CE2.d.querySelector(".grand_total .amount");super.sendCheckoutCompletedEvent([e&&e.innerText,t&&t.innerText&&this.amountInCents(t.innerText),this.currency])}static match(){return CE2.w&&CE2.w.checkout&&CE2.w.checkout.checkoutUrl&&CE2.w.checkout.websiteId||[...document.scripts].find((e=>e.src&&e.src.indexOf("Magento")>-1))||[...document.querySelectorAll("link")].find((e=>e.href&&e.href.indexOf("Magento")>-1))}}CE2BH.defineProperty(oe,"NAME","Magento");class ae extends Z{constructor(...e){super(...e);const t=CE2.w.location.host,s=this.onEvent.bind(this),r=()=>{window.wixDevelopersAnalytics.register(t,s)};CE2.w.wixDevelopersAnalytics?r():CE2.w.addEventListener("wixDevelopersAnalyticsReady",r)}onEvent(e,t){if("AddToCart"===e){const e=[t.sku,t.name,t.quantity,this.amountInCents(t.price),t.currency];this.addToCart(e)}"InitiateCheckout"===e&&this.startCheckout(),"Purchase"===e&&this.checkoutCompleted([t.orderId,this.amountInCents(t.revenue),t.currency])}static match(){return CE2.w&&!!CE2.w.fedops}}CE2BH.defineProperty(ae,"NAME","WixApi");class ce extends Z{constructor(...e){super(...e),CE2BH.defineProperty(this,"CHECKOUT_STARTED_PATH_REGEXP",/\/checkout\?cartToken/i),CE2BH.defineProperty(this,"CHECKOUT_COMPLETED_PATH_REGEXP",/\/website\/thank-you-page/i),CE2BH.defineProperty(this,"ADD_TO_CART_BUTTON_NAME_PATTERN",/add to (cart|bag|basket)/i),CE2BH.defineProperty(this,"CHECKOUT_BUTTON_NAME_PATTERN",/checkout/i)}onClick(e){const{target:t}=e;if((e=>(0,J.B5)(e,".sqs-add-to-cart-button",!0))(t)&&(e=>this.ADD_TO_CART_BUTTON_NAME_PATTERN.test(e.innerText||e.value))(t))return this.processAddToCardAction();(e=>this.CHECKOUT_BUTTON_NAME_PATTERN.test(e.innerText||e.value))(t)&&!this.getCheckoutStarted()&&this.startCheckout()}getProductData(){const e=CE2.d.querySelectorAll('script[type="application/ld+json"]'),t=CE2.d.querySelector(".product-variants[data-selected-variant]"),s=CE2.w.Static?.SQUARESPACE_CONTEXT?.product;let r;if(t?r=CE2.Native.JSON.parse(t.getAttribute("data-selected-variant")):1===s?.variants?.length&&([r]=s.variants),!r)return(0,i.Yz)("Variant not found"),null;for(let t=0;te.includes("__INITIAL_SQUARESPACE"))))}}CE2BH.defineProperty(ce,"NAME","Squarespace");const le=[ie,ne,oe,ae,ce],he=function(){for(let e=0;e|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pe=/\((\S*)(?::(\d+))(?::(\d+))\)/;const me=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const fe=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Ee=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;const ge=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;const ve=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Ce(e){return e.split("\n").reduce(((e,t)=>{const s=function(e){const t=de.exec(e);if(!t)return null;const s=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),i=pe.exec(t[2]);return r&&null!=i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:s?null:t[2],methodName:t[1]||ue,arguments:s?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}(t)||function(e){const t=me.exec(e);return t?{file:t[2],methodName:t[1]||ue,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}(t)||function(e){const t=fe.exec(e);if(!t)return null;const s=t[3]&&t[3].indexOf(" > eval")>-1,r=Ee.exec(t[3]);return s&&null!=r&&(t[3]=r[1],t[4]=r[2],t[5]=null),{file:t[3],methodName:t[1]||ue,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}(t)||function(e){const t=ve.exec(e);return t?{file:t[2],methodName:t[1]||ue,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}(t)||function(e){const t=ge.exec(e);return t?{file:t[3],methodName:t[1]||ue,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}(t);return s&&e.push(s),e}),[])}var ye=s(1881);class we{constructor(e=[]){this.cached_assets=new Set;for(let t=0;te.push(t))),e}}var be=s(3032);const ke=["Failed to execute 'importScripts' on 'WorkerGlobalScope'"];class Te{constructor(e){this.tracker=e,this.setupCache(),this.setupQueue(),"undefined"!=typeof CE_ERROR_TRACKING_CONFIG&&CE_ERROR_TRACKING_CONFIG.app_version&&(this.appVersion=CE_ERROR_TRACKING_CONFIG.app_version),"undefined"!=typeof CE_ERROR_TRACKING_CONFIG&&CE_ERROR_TRACKING_CONFIG.delay_time?this.delayTime=CE_ERROR_TRACKING_CONFIG.delay_time:this.delayTime=1e4,"undefined"!=typeof CE_ERROR_TRACKING_CONFIG&&CE_ERROR_TRACKING_CONFIG.fingerprint?this.fingerprint=CE_ERROR_TRACKING_CONFIG.fingerprint:this.fingerprint=(e,t)=>{const s=[];return s.push(`${t.name}`),t.file&&s.push(`[${t.file}:${t.lineno}:${t.colno}]`),s.join(" ")},this.tracker.addEventListener("error",(0,J.oI)(this,"onError")),this.tracker.addEventListener("unhandledrejection",(0,J.oI)(this,"onError"))}static removeFingerprintFrom(e){if(!e)return e;if(e.replace(".js","").match(/^([0-9]+([\-|\.|\_])?)+$/))return e;return e.split(/([a-z0-9]+[\-|\.|\_]+)/i).filter((e=>{if(!e)return!1;const t=e.replace(/[^0-9]/g,"").length,s=e.replace(/[\.\-\_]/,"").length,r=t===s;return!!(r&&t<=3)||!(t/s>.15||r)})).join("").replace(/[\-\.\_]js$/,".js")}update(){this.setupQueue(),this.setupCache()}onError(e){try{let t;t="Script error."===e.message?this.buildBaseError(e,e.reason,null,"CrossOrigin Error"):e.error?this.buildBaseError(e,e.error):e.promise?this.buildBaseError(e,e.reason,"UnhandledPromise ->"):this.buildBaseError(e);for(let e=0;e0;){const{timestamp:e,errorAttributes:r}=this.bufferQueue[0];if(!t&&+new Date-e{t(e)}),this.delayTime)}}flush(e){this.processQueue(!1,!0,e)}assignAttribute(e="rageClicked"){this.bufferQueue.forEach((t=>{t.errorAttributes[e]=!0}))}buildBaseError(e,t,s,r=null){const i=CE2BH.extends({},this.parseErrorFileAttributes(e,t),this.parseErrorMessageAttributes(e,t,r));return i.uuid=(0,J.Jl)(),i.appVersion=this.appVersion,i.url=CE2.w.location.href,i.name=s?`${s} ${i.name}`:i.name,i.fingerprint=e.fingerprint||this.fingerprint(e,i),i.rageClicked=!1,i.bounced=!1,i}parseErrorFileAttributes(e,t){let s={};if(e.filename)s={filename:e.filename,lineno:e.lineno,colno:e.colno,stack:t&&t.stack&&t.stack.toString()};else if(t&&t.stack)try{const e=Ce(t.stack);e.length>=1&&(s={filename:e[0].file,lineno:e[0].lineNumber,colno:e[0].column,stack:t.stack.toString()})}catch(e){(0,be.A)(e)}if(s.filename&&0!==s.filename.indexOf("blob:"))if(this.isValidFileUrl(s.filename)){const e=new CE2.URL(s.filename),t=new CE2.URL(CE2.w.location.href);if(e.path!==t.path){let t=e.path;"/"!==e.path&&"/"===e.path[e.path.length-1]&&(t=e.path.slice(0,e.path.length-1)),s.file="/"!==t?t.split("/").pop():t}}else s.file="unknown";return s.file=Te.removeFingerprintFrom(s.file),s}parseErrorMessageAttributes(e,t,s=null){const r={};if(t&&t.message){const e=t.message.replace(/^Uncaught /,"");r.message=t.name?`${t.name}: ${e}`:e}else if(t)r.message=t;else if(e.message)r.message=e.message.replace(/^Uncaught /,"");else if(e.target){const t=["Error on"];e.target.tagName&&t.push(e.target.tagName),e.target.src&&t.push(e.target.src!==CE2.w.location.href?e.target.src:"Empty src attribute"),r.message=t.join(" "),r.name="Unknown Resource Error"}return r.message||(r.message="Unknown Error"),s?r.name=s:r.name||(r.name=function(e){if(e.length<=50)return e.trim();const t=e.trim().split(" ");for(let e=1;e<=t.length;e++){const s=t.slice(0,e).join(" ");if(s.length<=50)continue;const r=e===t.length;return s.trim()+(r?"":" ...")}return e.trim()}(r.message)),r}isValidFileUrl(e){try{if(window.URL)return!!new window.URL(e)}catch(e){(0,be.A)(e)}}}const Se=[[.4,.4],[.5,.4],[.5,.5],[.4,.5],[.3,.5],[.3,.4],[.3,.3],[.4,.3],[.5,.3],[.6,.3],[.6,.4],[.6,.5],[.6,.6],[.5,.6],[.4,.6],[.3,.6],[.2,.6],[.2,.5],[.2,.4],[.2,.3],[.2,.2],[.3,.2],[.4,.2],[.5,.2],[.6,.2],[.7,.2],[.7,.3],[.7,.4],[.7,.5],[.7,.6],[.7,.7],[.6,.7],[.5,.7],[.4,.7],[.3,.7],[.2,.7],[.1,.7],[.1,.6],[.1,.5],[.1,.4],[.1,.3],[.1,.2],[.1,.1],[.2,.1],[.3,.1],[.4,.1],[.5,.1],[.6,.1],[.7,.1],[.8,.1],[.8,.2],[.8,.3],[.8,.4],[.8,.5],[.8,.6],[.8,.7],[.8,.8],[.7,.8],[.6,.8],[.5,.8],[.4,.8],[.3,.8],[.2,.8],[.1,.8],[0,.8],[0,.7],[0,.6],[0,.5],[0,.4],[0,.3],[0,.2],[0,.1],[0,0],[.1,0],[.2,0],[.3,0],[.4,0],[.5,0],[.6,0],[.7,0],[.8,0],[.9,0],[.9,.1],[.9,.2],[.9,.3],[.9,.4],[.9,.5],[.9,.6],[.9,.7],[.9,.8],[.9,.9],[.8,.9],[.7,.9],[.6,.9],[.5,.9],[.4,.9],[.3,.9],[.2,.9],[.1,.9],[0,.9]],_e=`cedk${Math.random().toString().replace(/\D/g,"")}`,Ae=[];function Ie(e,t,{allowNonStatic:s=!1}={}){if(!e||!e.nodeName)return!1;if(!CE2.d.documentElement.contains(e))return!1;if(e==CE2.d||e==CE2.d.documentElement||e==CE2.d.body)return!1;if((0,J.KQ)(e))return!1;if(!s&&!function(e){if(e[_e])return!1;for(;e&&e!=CE2.d&&e!=CE2.d.documentElement&&e!=CE2.d.body;e=e.parentNode){const t=CE2.w.getComputedStyle(e)?.position;if("absolute"===t||"fixed"===t||"sticky"===t)return!(e[_e]=!0)}return!0}(e))return!1;return!(CE2.fp.getBox(e).height>2*t.height)}class Oe{constructor(){this.lastRecordedScroll=null,this.lastRecordedTime=0,this.lastRecordedY=0,this.idleAt=null,this.idleSince=(new Date).getTime()}shouldRecordScroll(e){const t=e.top,s=e.height,r=`${t}:${s}`,i=(new Date).getTime();if(r==this.lastRecordedScroll)return!1;if(r==this.idleAt){if(i-this.idleSince>=800)return this.lastRecordedScroll=r,this.lastRecordedTime=i,this.lastRecordedY=t,!0}else this.idleAt=r,this.idleSince=i;return null==this.lastRecordedScroll||Math.abs(t-this.lastRecordedY)>s/2&&i-this.lastRecordedTime>=1600?(this.lastRecordedScroll=r,this.lastRecordedTime=i,this.lastRecordedY=t,!0):void 0}findAnchor(e,t){if(!CE2.d.elementsFromPoint)return t(e);let s=0;const{width:r}=e,{height:i}=e;let n=null;const o=()=>{const a=Se[s++];if(!a){for(let s=Ae.length-1;s>=0;s--){const r=Ae[s];if(Ie(r,e))return t(e,r)}return n&&Ie(n,e,{allowNonStatic:!0})?t(e,n):t(e,null)}{const s=(a[0]+.1*Math.random())*r,c=(a[1]+.1*Math.random())*i,l=CE2.d.elementsFromPoint(s,c);let h=null;for(let t=0;t10){const e=Ae.length-10;Ae.splice(0,e)}return t(e,h)}setTimeout(o,0)}};setTimeout(o,0)}}CE2.EXCESSIVE_SCROLL_TIMEOUT=3e3;var Ne=s(6315);const Re="ce_submit_forms";function Le(e,t){const s=e[t];return"string"==typeof s?s:e.getAttribute(t)}class Me{static formAttributes(e){return[Le(e,"id"),Le(e,"name"),new CE2.Native.URL(Le(e,"action"),CE2.w.location.href).toString()]}static validateEmail(e){const t=document.createElement("input");return t.type="email",t.required=!0,t.value=e,"function"==typeof t.checkValidity?t.checkValidity():/\S+@\S+\.\S+/.test(e)}constructor(e){CE2BH.defineProperty(this,"EMAIL_ATTRIBUTE_REGEX",/e([-_])?mail/i),CE2BH.defineProperty(this,"FORM_REGEX",/sign([-_\s])?up|checkout|log([-_\s])?in|sign([-_\s])?in/i),CE2BH.defineProperty(this,"eventTypes",{SUBMIT:1,RESUBMIT:2,ABANDON:3,SIGNUP:4,LOGIN:5,EMAIL:6,SEARCH:7}),this.tracker=e,this.tracker.addEventListener("mousedown",(e=>{"l"===(0,J.CU)(e)&&this.onClick(e)})),CE2.site?.settings?.autoIdentify&&!CE2.IDENTIFIER&&(CE2.w.ShopifyAnalytics&&te(CE2.w,"ShopifyAnalytics.meta.page.customerId")&&(0,Ne.ls)(CE2.w.ShopifyAnalytics.meta.page.customerId),this.tracker.addEventListener("blur",(0,J.oI)(this,"onBlur")),this.tracker.addEventListener("submit",(0,J.oI)(this,"onBlur"))),this.tracker.addEventListener("submit",(0,J.oI)(this,"onSubmit")),this.tracker.addEventListener("input",(0,J.oI)(this,"onInput")),this.tracker.addEventListener("beforeunload",(0,J.oI)(this,"beforeUnload")),this.editedForms=[],this.submittedForms=CE2.Native.JSON.parse(CE2.Native.sessionStorageWrapper.read(Re)||"[]")}onClick(e){const{target:t}=e;if(!t)return;const s=t.closest("form"),r="INPUT"===t.tagName&&("button"===t.type||"submit"===t.type);if(s&&r||"BUTTON"===t.tagName){const e="INPUT"===t.tagName?t.value:t.innerText;(/(log\s*in)|(sign\s*in)/i.test(e)||s&&/(log[\-_]in)|(sign[\-_]in)/i.test(s.action))&&this.sendEvent([this.eventTypes.LOGIN]),(/(sign\s*up)|register/i.test(e)||s&&/(sign[\-_\s]up)|register/i.test(s.action))&&this.sendEvent([this.eventTypes.SIGNUP])}"INPUT"!==t.tagName&&"BUTTON"!==t.tagName||"submit"===t.type&&s&&this.submit(s,t)}onSubmit(e){const t=(0,J.wt)(e);t&&(t.ce_submit&&+new Date-t.ce_submit<100||this.submit(t))}onBlur(e){try{const{target:t}=e;if(!t||"function"!=typeof t.closest)return;const s=t.closest("form"),r="INPUT"===t.tagName&&t.value&&Me.validateEmail(t.value);s&&this.isAuthForm(s)&&r&&!CE2.IDENTIFIER&&(0,Ne.ls)(t.value)}catch(e){(0,i.Yz)("form blur trigger failed",e)}}onInput(e){const{target:t}=e;if(!t)return;const s=t.closest("form");s&&!this.editedForms.includes(s)&&this.editedForms.push(s),s&&!s.ce_time_start&&(s.ce_time_start=+new Date),"INPUT"===t.tagName&&("search"===t.type||t.placeholder&&/search/i.test(t.placeholder))&&(!t.ce_search||+new Date-t.ce_search>3e4)&&(t.ce_search=+new Date,this.sendEvent([this.eventTypes.SEARCH])),"INPUT"===t.tagName&&t.value&&Me.validateEmail(t.value)&&(!t.ce_email_sent||+new Date-t.ce_email_sent>6e4)&&(t.ce_email_sent=+new Date,this.sendEvent([this.eventTypes.EMAIL]))}beforeUnload(){this.editedForms.forEach((e=>{this.sendEvent([this.eventTypes.ABANDON,...Me.formAttributes(e)])})),this.editedForms=[],CE2.Native.sessionStorageWrapper.write(Re,CE2.Native.JSON.stringify(this.submittedForms))}submit(e){try{const t=this.editedForms.indexOf(e);-1!==t&&this.editedForms.splice(t,1),e.ce_submit=+new Date;const s=Me.formAttributes(e);let r;-1!==this.submittedForms.indexOf(CE2.Native.JSON.stringify(s))?r=this.eventTypes.RESUBMIT:(this.submittedForms.push(CE2.Native.JSON.stringify(s)),r=this.eventTypes.SUBMIT);const i=[r,...s];e.ce_time_start&&(i.push(+new Date-e.ce_time_start),delete e.ce_time_start),this.sendEvent(i)}catch(e){(0,i.Yz)("form submit event failed",e)}}sendEvent(e=[]){e=[this.tracker.visitID,...e];const t=this.tracker.newEvent(CE2.eventTypes.FORM,{attributes:e});this.tracker.send(t)}isAuthForm(e){const t=Le(e,"action"),s=Le(e,"class"),r=Le(e,"id"),i=Le(e,"name");return this.isMatch(t)||this.isMatch(s)||this.isMatch(r)||this.isMatch(i)}isMatch(e,t=this.FORM_REGEX){return e&&e.match(t)}}class Pe{constructor(){this.events=[],this.api=this.apiName(),this.find(),this.listeners=new Set}destroy(){throw new Error(`${this.constructor.name}.destroy() not implemented`)}find(){throw new Error(`${this.constructor.name}.find() not implemented`)}apiName(){throw new Error(`${this.constructor.name}.apiName() not implemented`)}urlMatches(){throw new Error(`${this.constructor.name}.urlMatches(url) not implemented`)}getId(){throw new Error(`${this.constructor.name}.getId() not implemented`)}getEventType(){throw new Error(`${this.constructor.name}.getEventType() not implemented`)}recordEvent(e){const t={api:this.api,properties:e},s=this.getId(e);null!=s&&(t.id=s);const r=this.getEventType(e);"string"==typeof r&&r.trim().length>0&&(t.type=r),this.events.push(t),this.listeners.forEach((e=>{e(t)}))}addListener(e){this.listeners.add(e)}removeListener(e){this.listeners.delete(e)}}class De{constructor(){this.listeners=new Set,this.bufferedEvents=[]}trigger(...e){0===this.listeners.size?this.bufferedEvents.push(e):this.listeners.forEach((t=>{t(...e)}))}destroy(){throw new Error(`${this.constructor.name}.destroy() not implemented`)}triggerBuffered(){if(this.bufferedEvents.length>0){for(let e=0,t=this.bufferedEvents;e{this.trigger(e.getAttribute("src"))})),this.observer.observe(document.documentElement,{subtree:!0,childList:!0})}onMutation(e){for(let t=0;t{t[s]=e})),t}class Ue extends Pe{constructor(){super(),this.$onScript=this.onScript.bind(this),Be.addListener(this.$onScript)}destroy(){Be.removeListener(this.$onScript)}apiName(){return"google"}urlMatches(e){if(!e||"string"!=typeof e)return;return["googleadservices.com/pagead/conversion/","googleads.g.doubleclick.net/pagead/viewthroughconversion/"].some((t=>e.toLowerCase().includes(t.toLowerCase())))}find(){const e=new Set;for(let t=0,s=document.querySelectorAll('script[src*="/gtag/"]');t0&&(this.ids=Array.from(e))}getId(e){if(e.source_url){const t=/\/pagead\/(viewthrough)?conversion\/([^/?#]+)/.exec(e.source_url);if(t&&t[2])return t[2]}}getEventType(e){if(e.gclid&&(e.medium||e.utm_medium))return"ad_click";const{data:t}=e;if(t){const e=/event=([^;]+)/.exec(t);if(e&&e[1])return e[1]}}onScript(e){if(!this.urlMatches(e))return;const t=xe(e);t.source_url=e,this.getEventType(t)&&this.recordEvent(t)}detectAdWordsConversion(e){const t=xe(e||window.location.href);t.gclid&&("cpc"===t.medium&&t.gad_source||"paid_search"===t.utm_medium&&t.utm_source)&&this.recordEvent(t)}}const Fe=window.Image;function He(...e){const t=new Fe(...e);return Object.defineProperty(t,"src",{set(e){setTimeout((()=>{Ve.trigger(e)}),0),t.setAttribute("src",e)},get:()=>t.getAttribute("src")}),t}class Ve extends De{constructor(){super(),window.Image=He,window.Image.toString=()=>Fe.toString()}destroy(){window.Image=Fe}}class $e extends Pe{constructor(){super(),this.$onImage=this.onImage.bind(this),Ve.addListener(this.$onImage)}destroy(){Ve.removeListener(this.$onImage)}apiName(){return"meta"}urlMatches(e){return e.startsWith("https://www.facebook.com/tr/")}find(){if(window.fbq&&window.fbq.instance&&window.fbq.instance.pixelsByID){const e=Object.keys(window.fbq.instance.pixelsByID);e.length>0&&(this.ids=e)}}getId(e){return e.id}getEventType(e){return e.ev}onImage(e){if(!this.urlMatches(e))return;const t=xe(e);this.getEventType(t)&&this.recordEvent(t)}}const qe=navigator.sendBeacon;function Ge(e,t){return setTimeout((()=>{try{Ke.trigger(e,t)}catch(e){console.error("sendBeacon error: ",e.stack)}}),0),qe.call(navigator,e,t)}class Ke extends De{constructor(){super(),navigator.sendBeacon=Ge,navigator.sendBeacon.toString=()=>qe.toString()}destroy(){navigator.sendBeacon=qe}}class We extends Pe{constructor(){super(),this.$onSendBeacon=this.onSendBeacon.bind(this),Ke.addListener(this.$onSendBeacon)}destroy(){Ke.removeListener(this.$onSendBeacon)}apiName(){return"tiktok"}urlMatches(e){return e.startsWith("https://analytics.tiktok.com/")}find(){const e=document.querySelectorAll('script[src*="analytics.tiktok.com"][data-id]'),t=new Set(Array.from(e).map((e=>e.dataset.id)));t.size>0&&(this.ids=Array.from(t))}getId(e){return e?.context?.pixel?.code}getEventType(e){return e.event}onSendBeacon(e,t){if(!this.urlMatches(e))return;const s=JSON.parse(t);this.getEventType(s)&&this.recordEvent(s)}}const ze={google:Ue,meta:$e,tiktok:We};class Ye{constructor(e="all"){if("all"===e)this.pixels={google:new Ue,meta:new $e,tiktok:new We};else{this.pixels={};for(let t=0;t{this.findPixels(),this.initMutationObserver()},document.addEventListener("DOMContentLoaded",this.$onDomReady),this.findPixels(),this.initMutationObserver()}destroy(){document.removeEventListener("DOMContentLoaded",this.$onDomReady),window.removeEventListener("load",this.$onLoad);for(let e=0,t=Object.values(this.pixels);e{for(let t=0;t{if(!s||s.type!==t)return!1;if(!e.on_any_page&&!(0,Xe.V4)(e.on_page,CE2.w.location.href))return!1;let i=e[`selector_for_${{1:"desktop",2:"phone",3:"tablet"}[CE2.clock.getDeviceType()]}`];return!!i&&("function"==typeof CE2.fixTriggerSelector&&(i=CE2.fixTriggerSelector(r,i)),!(!i||!(0,J.B5)((0,J.wt)(s),i,!0)))};var Ze=s(8389);Xe.DM.url_visit=Xe.DM.visited_page,Xe.DM.click=(e,{operand:t}={})=>{const{event:s,goalId:r}=t;return Je(e,"mousedown",s,r)},Xe.DM.form_submission=(e,{operand:t}={})=>{const{event:s,goalId:r}=t;return Je(e,"submit",s,r)},Xe.DM.pixel_event=(e,{operand:t}={})=>((e,t)=>{if(!e.on_any_page&&!(0,Xe.V4)(e.on_page,CE2.w.location.href))return!1;if(e.api!==t.api)return!1;const s="string"==typeof e.event&&e.event.toLowerCase();return!(s&&s!==t.type.toLowerCase()||"ad_click"!==s&&"string"==typeof e.id&&e.id.replace(/^(G|AW)-/,"")!==t.id)})(e,t.event),Xe.DM.ecommerce_event=(e,{operand:t}={})=>((e,t)=>{if(!e.on_any_page&&!(0,Xe.V4)(e.on_page,CE2.w.location.href))return!1;if(e.api!==t.detail?.api)return!1;const s="string"==typeof e.event&&e.event.toLowerCase();return!s||s===t.detail?.type?.toLowerCase()})(e,t.event);class et{constructor(e){this.tracker=e,this.goals=this.tracker.goals;const t=(0,J.oI)(this,"onClickOrSubmit");this.tracker.addEventListener("mousedown",t),this.tracker.addEventListener("submit",t);const{onActivity:s}=et;this.tracker.addEventListener("mousemove",s),this.tracker.addEventListener("scroll",s),this.tracker.addEventListener("keydown",s),this.tracker.addEventListener("pagehide",s);const r=(0,J.oI)(this,"onEcommerceEvent");this.tracker.addEventListener("crazyegg.addToCart",r),this.tracker.addEventListener("crazyegg.startCheckout",r),this.tracker.addEventListener("crazyegg.checkoutCompleted",r);const i=(0,J.oI)(this,"onHubSpotMessage");this.tracker.addEventListener("message",i),this.pixelObserver=new Ye(et.pixelApisFromGoals(this.goals)),this.pixelObserver.addEventListener(this.onPixelEvent.bind(this)),this.pixelObserver.pixels?.google?.detectAdWordsConversion(),this.goalValuesObserver=new Qe.O(this.goals,[this.onGoalValueEvent.bind(this)]),this.setupGravityFormsListener(),this.setupNinjaFormsListener()}cleanup(){this.pixelObserver.destroy(),delete this.pixelObserver}setupNinjaFormsListener(){CE2.w.jQuery&&CE2.w.jQuery(CE2.d).on("nfFormSubmitResponse",((e,{id:t})=>{this.onNinjaFormSuccess(t)}))}setupGravityFormsListener(){CE2.w.gform?.utils&&CE2.w.gform.utils.addAsyncFilter("gform/submission/pre_submission",(async e=>{try{this.onGravityFormSuccess(e)}catch(e){console.error("Gravity Forms goal tracking failed",e)}return e}))}onNinjaFormSuccess(e){CE2.d.querySelectorAll(`#nf-form-${e}-cont form`).forEach((e=>{const t={type:"submit",target:e};this.processFormSubmission(t)}))}onHubSpotMessage(e){if(CE2.w.hubspot&&e.data&&"hsFormCallback"===e.data.type&&"onFormSubmitted"===e.data.eventName){const t=e.data.id;if(!t)return;const s={type:"submit",target:{matches:e=>{if(!e||"string"!=typeof e)return!1;const s=e.toLowerCase(),r=`hsform_${t}`.toLowerCase();return s.includes(`#${r}`)||s.includes(r)},ownerDocument:CE2.d,closest:()=>null,getRootNode:()=>CE2.d}};this.processFormSubmission(s)}}onGravityFormSuccess(e){if(e?.form){const t={type:"submit",target:e.form};this.processFormSubmission(t)}}processFormSubmission(e){je.r.alive(),(0,Ze.Bi)("form_submission",e),this.goals.forEach((t=>{t.triggers.forEach((s=>{const r=s.filter.conditions.filter((e=>"form_submission"===e.criteria));0!==r.length&&this.matchGoal(t,s,r,"form_submission",e)}))}))}onClickOrSubmit(e){je.r.alive(),"mousedown"===e.type&&(0,Ze.Bi)("click",e),"submit"===e.type&&(0,Ze.Bi)("form_submission",e),this.goals.forEach((t=>{t.triggers.forEach((s=>{const r=s.filter.conditions.filter((e=>"click"===e.criteria||"form_submission"===e.criteria));0!==r.length&&this.matchGoal(t,s,r,"click",e)}))}))}onUrlVisit(){this.goals.forEach((e=>{e.triggers.forEach((t=>{const s=t.filter.conditions.filter((e=>"url_visit"===e.criteria));0!==s.length&&this.matchGoal(e,t,s)}))}))}onPixelEvent(e){(0,Ze.Bi)("pixel_event",e),this.goals.forEach((t=>{t.triggers.forEach((s=>{const r=s.filter.conditions.filter((e=>"pixel_event"===e.criteria));0!==r.length&&this.matchGoal(t,s,r,"pixel_event",e)}))}))}onEcommerceEvent(e){e.detail&&(0,Ze.Bi)("ecommerce_event",{api:e.detail.api,type:e.detail.type}),this.goals.forEach((t=>{t.triggers.forEach((s=>{const r=s.filter.conditions.filter((e=>"ecommerce_event"===e.criteria));0!==r.length&&this.matchGoal(t,s,r,"ecommerce_event",e)}))}))}onGoalValueEvent(e){CE2.nextGoalConversionValue(e.goal.id,e.value,e.trigger.id)}matchGoal(e,t,s,r,i){if((0,Xe._9)(s,{operand:{event:i,goalId:e.id}})){let s;i?.detail?.value&&(s={worth:i.detail?.value,currency:i.detail?.currency||je.r.getCurrency()}),this.tracker.goalConversion({goalId:e.id,value:s,triggerId:t.id,skipSessionWorth:"ecommerce_event"===r}),(0,Ze.ww)("goal_conversions",String(e.id))}}static onActivity(){const e=+new Date;et.lastActive&&e-et.lastActive<=1e4||(et.lastActive=e,je.r.alive())}static pixelApisFromGoals(e){if(!CE2.Native.Array.isArray(e))return[];const t=new Set;return e.forEach((e=>{e.triggers.forEach((e=>{e.filter.conditions.forEach((e=>{"pixel_event"===e.criteria&&e.values.forEach((e=>{e.api&&t.add(e.api)}))}))}))})),CE2.Native.Array.from(t)}}const tt=/[:@;%~='"\|\*\/\\\.\[\]\{\}\(\)]/g,st=/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/;function rt(e){if(e instanceof DocumentFragment)return":scope";let t=[];const{id:s}=e;if(t.push(e.nodeName.toLowerCase()),s&&"string"==typeof s&&!/^\d/.test(s))t.push(`#${i=s,i.replace(tt,"\\$&").replace(/^\s+|\s+$/g,"")}`);else{const s=(r=e,[].slice.call(r.classList).filter((e=>e.match(st))).map((e=>`.${e}`)).join(""));s&&t.push(s)}var r,i;if(t=t.join(""),1===e.parentNode.querySelectorAll(t).length)return t;const n=function(e){const{children:t}=e.parentNode;let s=0;for(let r=0;r ")),1!==i.length);e=e.parentNode);return e._ce_selector=t.join(" > ")}function ot(e){try{!e||e.isCensored||CE2.d.hidden||(e.ce||(e.ce={}),e.ce.imgScheduled||(e.ce.imgScheduled=!0,setTimeout((()=>{try{e.ce.imgScheduled=!1,e.toBlob((t=>{const s=new CE2.Native.URL(`/canvas-urls/${e.width}x${e.height}/${t.size}/${t.type&&t.type.replace("/",".")}`,CE2.d.baseURI).toString();e.ce.imgUrl=s,e.ce.blob=t,s!==e.getAttribute("ce-img-taken")&&e.setAttribute("ce-img-taken",s)}),"image/webp")}catch(e){(0,i.Yz)("error saving the canvas image",e)}}),1e3)))}catch(e){(0,i.Yz)("error saving the canvas image",e)}}function at(e){ot(e.canvas)}const ct=[{type:CE2.w.CanvasRenderingContext2D,methods:["stroke","fillText","strokeText","fillRect","drawImage","clearRect","translate","transform","fill","clear","rect","strokeRect","putImageData"]}],lt={track(){this.overridden||(ct.forEach((e=>{e.type&&e.methods&&e.methods.forEach((t=>{!function(e,t,s){const r=e.prototype[t];e.prototype[t]=function(...e){r.call(this,...e),s(this,t,...e)}}(e.type,t,at)}))})),CE2.d.querySelectorAll("canvas").forEach((e=>{ot(e)})),this.overridden=!0)}};const ht="ce_visit_timings";const ut=(0,s(6445).N)();CE2.ASSET_COLLECTOR_IGNORE_DOMAINS=["bat.bing.com","www.facebook.com/tr","www.google.","www.google-analytics.","ssl.google-analytics.","www.googletagmanager.","googleads.g","sp.analytics.yahoo.","heapanalytics.com","dev.visualwebsiteoptimizer.","b.6sc.co","hn.inspectlet.","d.adroll.","secure.adnxs.","match.adsrvr.","ads.travelaudience.","www.linkconnector.","px.ads.linkedin.","cdn.bizible.","ih.adscale.","rtb-csync.smartadserver.","x.bidswitch.net/sync","ad.doubleclick."];const dt={3:"Crazy Egg Bot",2:"Crazy Egg Bot (Mobile)",1:"Crazy Egg Bot"};class pt{constructor(e=null){if(e){this.storageKey=e;const t=CE2.Native.sessionStorageWrapper.read(this.storageKey);t&&(this.queue=CE2.Native.JSON.parse(t))}this.queue||(this.queue=[])}push(e){const t=[];for(let s=0;se.url===r.url));if(i>=0)this.queue[i]=r;else{t.findIndex((e=>e.url===r.url))<0&&t.push(r)}}t.length&&(this.queue=this.queue.concat(t)),this.updateStorage()}fetch(e){const t=this.queue.splice(0,e);return this.updateStorage(),t}include(e){return this.queue.findIndex((t=>t.url===e))>-1}length(){return this.queue.length}updateStorage(){this.storageKey&&CE2.Native.sessionStorageWrapper.write(this.storageKey,CE2.Native.JSON.stringify(this.queue))}}class mt{constructor(e){this.tracker=e,this.OBSERVER_CACHE_KEY="ce_asset",this.LOCAL_CACHE_ASSET_MAX_SIZE=5e3,this.LOCAL_ASSET_OBSERVER_CACHE_KEY="ce_local_asset_cache",this.WAITING_QUEUE_KEY="ce_asset_waiting",this.SAMPLE_INTERVAL="undefined"==typeof CE_ASSET_COLLECTOR_INTERVAL?1e4:CE_ASSET_COLLECTOR_INTERVAL,this.URL_REGEX=/url\(["'](.+?)["']\)/,this.BATCH_SIZE=20;const t=new Set;for(let e=0,s=CE2.ASSET_COLLECTOR_IGNORE_DOMAINS;e{this.IGNORE_DOMAINS.push(e)}))}setup(){this.uri=new CE2.URL(CE2.w.location.toString()),this.setupObserverCache(),this.setupWorker(),this.schedulePerformanceObserver(),this.scheduleDataAndBlobCollection(1e3),this.collectCanvasImages()}cleanup(){this.performanceObserver&&(this.performanceObserver.disconnect(),delete this.performanceObserver),this.collectAssetsTimeout&&clearTimeout(this.collectAssetsTimeout),this.collectCanvasImagesTimeout&&clearTimeout(this.collectCanvasImagesTimeout),this.worker&&this.worker.terminate()}setupObserverCache(){const e=CE2.Native.sessionStorageWrapper.read(this.LOCAL_ASSET_OBSERVER_CACHE_KEY);this.observerCache=e?new we(CE2.Native.JSON.parse(e)):new we}addObserverCache(e){if(e&&e.length){for(let t=0;t{this.handlePerformanceEntries(e.getEntries())})),this.performanceObserver.observe({entryTypes:["resource"]})))}scheduleDataAndBlobCollection(e){this.collectAssetsTimeout=setTimeout((0,J.oI)(this,"collectDataAndBlobAssets"),e)}handlePerformanceEntries(e){const t=[];let s;const r=[];let i=!1;for(let n=0;ne.forEach((e=>r.push(e.href))))),i=!0),r.includes(o.name)&&(a=!0)),a&&(s=this.prepareAsset(o.name,{source:"network"}),s&&t.push(s))}this.queueForWorker(t)}setupWorker(){if(!this.worker){if(this.workerQueue=new pt,this.workerWaitingQueue=new pt(this.WAITING_QUEUE_KEY),this.worker=(0,J.UO)("crazyegg-assets",(e=>{if("undefined"==typeof CE2libs)return void CE2.debug("[Tracker] CE2libs not available");const{assets:t,session:s,uid:r,origin:i,trackURL:n,trackingKey:o,userAgent:a}=e.data,c={session:s,uid:r,origin:i,assets:[],userAgent:a};for(let e=0;e-1?r.digest=CE2libs.md5(s.data):r.digest=CE2libs.md5((new FileReaderSync).readAsText(s.data.slice(0,8e3)))),c.assets.push(r)}CE2.http.send(`${n}/assets?tk=${o}`,JSON.stringify(c),{contentType:"application/json",retry:5,callback:e=>{let s;if(200===e.status)s=JSON.parse(e.responseText);else{if(204!==e.status)return void postMessage({status:e.status,assets:t});s=[]}for(let e=0;er.url===e.url));i?(r.status=i.status,r.s3=i.s3):(r.status=2,r.timestampEnd=+new Date,r.collector="s")}CE2.promisePool(t,2,(e=>new Promise((t=>{if(e.s3){const s=new CE2.FormData;for(let t=0,r=Object.keys(e.s3.fields);t{e.status=2,e.timestampEnd=+new Date,e.collector="c",t(e)}})}else t(e)})))).then((()=>{postMessage({status:"ok",assets:t})})).catch((e=>{CE2.debugError(e)}))}})}),!0),!this.worker)return;this.worker.onmessage=e=>{const t=[],s=[],r=[];"ok"!==e.data.status&&CE2.debug("[Tracker] Assets api unavailable",e.data.status);for(let i=0,n=e.data.assets;i0?this.runWorker():setTimeout((0,J.oI)(this,"runWorker"),this.SAMPLE_INTERVAL)},this.runWorker()}}queueForWorker(e){e.length&&this.workerQueue.push(e)}runWorker(e){let t=e;t&&t.length||(t=this.workerQueue.fetch(this.BATCH_SIZE),t.length||(t=this.workerWaitingQueue.fetch(this.BATCH_SIZE))),t.length?this.fetchAssetsData(t).then((e=>{this.worker.postMessage({assets:e,session:this.tracker.session.id,uid:CE2.data.uid,origin:`${CE2.w.location.protocol}//${CE2.w.location.host}`,trackURL:this.tracker.trackURL,trackingKey:CE2.data.tracking_key,userAgent:CE2.site?.settings?.explicitAgent&&dt[CE2.clock.getDeviceType()]||""})})).catch((e=>{CE2.debugError(e)})):setTimeout((0,J.oI)(this,"runWorker"),this.SAMPLE_INTERVAL)}isBlobUrl(e){return 0===e.indexOf("blob:")}fetchAssetsData(e){return new Promise((t=>{CE2.promisePool(e,2,(e=>new Promise((t=>{if(!e.data&&e.corsSafe){let s=e.originalUrl;if(!e.local){const e=new CE2.URL(s);e.query=e.query&&e.query.length?`${e.query}&`:"",e.query+="ce=true",s=e.getFullUrl()}try{CE2.http.get(s,(s=>{200===s.status&&s.response?(e.data=s.response,e.contentType=s.getResponseHeader("Content-Type"),e.contentLength=s.response.size?s.response.size:parseInt(s.getResponseHeader("Content-Length"),10)):e.failed=!0,t(e)}),"blob")}catch(s){e.failed=!0,t(e)}}else t(e)})))).then((e=>{const s=[],r=[];for(let t=0;t=0)return}let i=e;this.isBlobUrl(e)&&(i=e.replace("blob:","")),0===e.indexOf("data:")&&(i=`${CE2.w.location.protocol}//${CE2.w.location.host}/data-urls/${e.length}`),0===i.indexOf("//")&&(i=`${r.protocol}:${i}`);let n=new CE2.URL(i);n.host||(n=r.join(n)),n.normalize();const o=n.getFullUrl();return"http"!==n.protocol&&"https"!==n.protocol||this.checkObserverCache(o)||this.workerWaitingQueue.include(o)?void 0:(s.url=n.getFullUrl(),s.cacheKey=o,this.localUrl(s.url)&&(s.local=!0,s.corsSafe=!0),s)}isBlobOrDataUrl(e){return e&&(e.indexOf("blob:")>=0||e.indexOf("data:")>=0)}sendEvent(e){const t=[];for(let s=0;s0)continue;const i=[r.url,r.status,r.timestamp];r.timestampEnd&&(i.push(r.timestampEnd),i.push(r.collector)),t.push(i)}if(!t.length)return;const s=[this.tracker.visitID,t],r=this.tracker.newEvent(CE2.eventTypes.ASSETS,{attributes:s});this.tracker.send(r)}}const ft={PageState:class{constructor(e){this.tracker=e,this.pageStateCapturing=!1}update(e){if(this.prevState=null,e&&this.pageStateCapturing&&(CE2.pageState.stopCapture(),this.pageStateCapturing=!1),!this.pageStateCapturing){(0,J.jI)("v11_canvas_tracking")&<.track();try{CE2.pageState.startCapture(this.captureOptions()),this.pageStateCapturing=!0}catch(e){this.tracker.pageStateError(e)}}}cleanup(){this.pageStateCapturing&&CE2.pageState.stopCapture()}trigger(e,t,s,r,i,n){if(!this.prevState||this.prevState.pageUrl!==e||this.prevState.md5!==s){const o=[i||this.tracker.visitID,e,s,t,n],a=this.tracker.newEvent(CE2.eventTypes.PAGE_STATE,{timestamp:r,attributes:o});this.tracker.send(a,{timestamp:r}),this.prevState={pageUrl:e,md5:s}}}captureOptions(){const{tracker:e}=this;return{uid:CE2.data.uid,trackURL:e.trackURL,getVisitId:()=>e.visitID,getUrl:()=>e.url,onPageState:(...t)=>e.pageState(...t),onPageStateError:(...t)=>e.pageStateError(...t),censoredElements:e.censoredElements,hideIframes:e.hideIframes,disableMasking:!!CE2.data.disable_recordings_masking,disableEmailMasking:!!CE2.data.disable_recordings_email_masking,stylesheetPerformance:(0,J.jI)("v11_page_state_performance")}}},Error:Te,Scroll:class{constructor(e){this.tracker=e,this.scrollTracker=new Oe,this.trackScrollInterval=setInterval((0,J.oI)(this,"trackScroll"),100),this.foundAnchorBind=(0,J.oI)(this,"foundAnchor"),this.resetLimitCount()}update(){this.resetLimitCount()}cleanup(){clearInterval(this.trackScrollInterval),delete this.scrollTracker,delete this.foundAnchorBind,this.resetLimitCount()}trackScroll(){if(this.overLimit())return;const e=CE2.fp.scroll();this.scrollTracker?.shouldRecordScroll(e)&&this.scrollTracker.findAnchor(e,this.foundAnchorBind)}foundAnchor(e,t){const s=e.top,r=e.height;let i,n,o;this.scrollTotal+=1,t&&(t=this.tracker.getElementToRecord(t),i=this.tracker.getFingerprint(t),n=e.top-i.pageY,o=e.top+e.height-i.pageY);const a=[this.tracker.visitID,...this.tracker.getFingerprintAttributes(i,{blank:["name"]}),s,r,n,o],c=this.tracker.newEvent(CE2.eventTypes.SCROLL,{attributes:a});this.tracker.send(c)}resetLimitCount(){this.scrollTotal=0}overLimit(){return!!(0,J.jI)("per-visit-event-limit")&&this.scrollTotal>=1e3}},Ecommerce:he,GoalConversion:et,ExcessiveScroll:class{constructor(e){this.tracker=e,this.timeout=CE2.EXCESSIVE_SCROLL_TIMEOUT,this.isTriggered=!1,this.isScrolledDown=!1,this.scrollTracker=new Oe,this.viewport=null,setTimeout((0,J.oI)(this,"cleanup"),this.timeout),this.trackScrollInterval=setInterval((0,J.oI)(this,"trackScroll"),500),this.foundAnchorBind=(0,J.oI)(this,"foundAnchor")}cleanup(){clearInterval(this.trackScrollInterval),this.isTriggered=!1,this.isScrolledDown=!1,this.viewport=null,delete this.scrollTracker,delete this.foundAnchorBind}trackScroll(){const e=CE2.fp.scroll();this.scrollTracker?.findAnchor(e,this.foundAnchorBind)}foundAnchor(e,t){if(this.isTriggered)return;const s=this.anchorViewport(e,t),r=s.viewportTop/s.viewportHeight*100;this.isScrolledDown?r<=80&&(this.sendEvent(this.viewport),this.isTriggered=!0):r>90&&(this.viewport=s,this.isScrolledDown=!0)}anchorViewport(e,t){const s=e.top,r=e.height;let i,n,o;return t&&(t=this.tracker.getElementToRecord(t),i=this.tracker.getFingerprint(t),n=e.top-i.pageY,o=e.top+e.height-i.pageY),{viewportTop:s,viewportHeight:r,viewportTopDistance:n,viewportBottomDistance:o}}sendEvent({viewportTop:e,viewportHeight:t,viewportTopDistance:s,viewportBottomDistance:r}){const i=[this.tracker.visitID,e,t,s,r],n=this.tracker.newEvent(CE2.eventTypes.EXCESSIVE_SCROLL,{attributes:i});this.tracker.send(n),this.tracker.addTag("excessive scroll")}},MouseMovement:class{constructor(e){CE2BH.defineProperty(this,"mouseEventTypes",{movement:"m",mouseup:"u",mousedown:"d"}),this.tracker=e,this.mousePos=null,this.mousePositions=[],this.tracker.addEventListener("mousemove",(0,J.oI)(this,"mousemove")),this.tracker.addEventListener("mouseup",(0,J.oI)(this,"mouseup")),this.tracker.addEventListener("mousedown",(0,J.oI)(this,"mousedown")),this.tracker.addSampleCallback((0,J.oI)(this,"sample")),this.tracker.addDiffCallback((0,J.oI)(this,"diff"))}overLimit(){const e=this.tracker?.commonEventHandlers?.click;return e?.overLimit()}cleanup(){}mousedown(e){if(!e)return;this.tracker.onActivity();const t=this.buildMouseEvent(e,this.mouseEventTypes.mousedown);t&&(this.mousePos=t,this.sample())}mouseup(e){if(!e)return;this.tracker.onActivity();const t=this.buildMouseEvent(e,this.mouseEventTypes.mouseup);t&&(this.mousePos=t,this.sample())}mousemove(e){if(!e)return;this.tracker.onActivity();const t=this.buildMouseEvent(e,this.mouseEventTypes.movement);t&&(this.mousePos=t)}sample(){try{const{mousePos:e}=this;if(e){const t=this.mousePositions[this.mousePositions.length-1];if(t&&((e,t)=>{const s=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(s.length!=r.length)return!1;for(let r=0;r0){const e=[];for(let t=0,s=this.mousePositions;te===t.type&&t.type.toLowerCase())))&&(this.lastTypedElement!==t||this.lastTypedTime-s>this.LIMIT_BETWEEN_TYPE_EVENTS)){const e=(0,J.B5)(t,"form *"),r=[this.tracker.visitID,e],i=this.tracker.newEvent(CE2.eventTypes.TYPING,{attributes:r});this.tracker.send(i),e&&(this.formEntry=s)}this.lastTypedElement=t,this.lastTypedTime=t}},SessionScroll:class{constructor(e){this.tracker=e,this.scrolls=[],this.calculateInitialScrolls(),this.tracker.addEventListener("scroll",(0,J.oI)(this,"onScroll"),ut),this.tracker.addDiffCallback((0,J.oI)(this,"diff"))}onScroll(e){if(this.tracker.onActivity(),this.overLimit())return;let t=e.target;t===CE2.d&&(t=CE2.d.scrollingElement);const s=e.composed&&e.composedPath();this.bufferScrollFor(t,s)}bufferScrollFor(e,t=null){const s=function(e,t=null){if(!t)return[nt(e)];const s=[[]];for(let e=0;ent(e[0])))}(e,t||ut.getComposedPath(e)),r=this.scrollKey(s),i=this.scrolls.find((e=>this.scrollKey(e[0])===r)),n=Date.now(),o=this.recordScrollOfElement(e);if(i){const t=i[1],s=t[t.length-1];n-s[2]>this.tracker.SAMPLE_INTERVAL?t.push(o):(s[0]=e.scrollTop,s[1]=e.scrollLeft)}else this.scrolls.push([s,[o]])}recordScrollOfElement(e){return[e.scrollTop,e.scrollLeft,+new Date]}diff(){try{if(this.scrolls.length>0){const e=[this.tracker.visitID,this.scrolls],t=this.tracker.newEvent(CE2.eventTypes.SESSION_SCROLL,{attributes:e});this.tracker.send(t),this.scrolls=[]}}catch(e){(0,be.A)(e)}}scrollKey(e){return e.join("→")}calculateInitialScrolls(){const e=CE2.d.querySelectorAll("html, body, body *");for(let t=0;te.type)).includes("reload")}update(e,t){if(this.isReloadedVisit)return;const{pathname:s}=CE2.w.location;if(!this.visitPath||t){this.visitPath=s,this.currentVisit=this.getVisitTiming(s)||{};const e=+new Date;if(this.currentVisit&&this.currentVisit.endTime&&this.currentVisit.endTime-e<2e4){const e=[this.tracker.visitID],t=this.tracker.newEvent(CE2.eventTypes.QUICKBACK,{attributes:e});this.tracker.send(t)}this.isReloadedVisit=!1}}unload(){return this.currentVisit&&(this.currentVisit.endTime=+new Date,this.putVisitTiming(this.visitPath,this.currentVisit)),!1}putVisitTiming(e,t){const s=this.getVisitsTimings();s[e]=t,CE2.Native.sessionStorageWrapper.write(ht,CE2.Native.JSON.stringify(s))}getVisitTiming(e){return this.getVisitsTimings()[e]}getVisitsTimings(){return CE2.Native.JSON.parse(CE2.Native.sessionStorageWrapper.read(ht)||"{}")}},Resize:class{constructor(e){this.tracker=e,this.browserSizes=[],this.tracker.addSampleCallback((0,J.oI)(this,"sample")),this.tracker.addDiffCallback((0,J.oI)(this,"diff"))}sample(){try{const e=CE2.w,t=e.innerWidth||e.screen.availWidth,s=e.innerHeight||e.screen.availHeight,{lastBrowserSize:r}=this;if(r&&r[0]===t&&r[1]===s)return;if(re&&r&&r[0]===t&&r[1]!==s)return;this.lastBrowserSize=[t,s,+new Date],this.browserSizes.push(this.lastBrowserSize)}catch(e){(0,be.A)(e)}}diff(){try{if(this.browserSizes.length>0){const e=[this.tracker.visitID,this.browserSizes],t=this.tracker.newEvent(CE2.eventTypes.RESIZE,{attributes:e});this.tracker.send(t),this.browserSizes=[]}}catch(e){(0,be.A)(e)}}},Activity:class{constructor(e){CE2BH.defineProperty(this,"ACTIVITY_WINDOW",1e4),CE2BH.defineProperty(this,"INACTIVE_TIME_LIMIT",9e4),this.tracker=e,this.trigger()}update(){this.trigger()}trigger(){const e=+new Date;if(this.lastActive){const t=e-this.lastActive;if(t>this.INACTIVE_TIME_LIMIT){const e=[this.tracker.visitID,t],s=this.tracker.newEvent(CE2.eventTypes.INACTIVE,{attributes:e});this.tracker.send(s,{timestamp:this.lastActive})}}const t=this.lastActive&&e-this.lastActive;t&&t<=this.ACTIVITY_WINDOW||(this.lastActive=e,this.tracker.session&&this.tracker.session.alive())}},Visibility:class{constructor(e){this.tracker=e,this.tracker.addEventListener("visibilitychange",(0,J.oI)(this,"onVisibilitychange"))}onVisibilitychange(){if(this.tracker.pageUnloading)return;const e=!document.hidden;if(this.tracker.isDocumentHiddenOnce||(this.tracker.isDocumentHiddenOnce=document.hidden),this.pageVisibility!==e){this.pageVisibility=e;const t=[this.tracker.visitID,e],s=this.tracker.newEvent(CE2.eventTypes.PAGE_VISIBILITY,{attributes:t});this.tracker.send(s),this.tracker.processBuffer({sendBeacon:!0})}}},Metric:class{constructor(e){this.tracker=e,this.tracker.addEventListener(CE2.opera?"unload":"beforeunload",(0,J.oI)(this,"onUnload"))}trigger(e,t){if(e.length>100)throw new Error("Key is too long (max 100)");if((t=Number(t,10))&&Number.isNaN(Number(t)))throw new Error("Value is NaN");const s=[this.tracker.visitID,e,t||""],r=this.tracker.newEvent(CE2.eventTypes.CUSTOM_PERFORMANCE,{attributes:s});this.tracker.send(r)}onUnload(){if(Object.keys(a.metrics).length)for(let e=0,t=Object.keys(a.metrics);e{"use strict";s.d(t,{A:()=>o,N:()=>n});var r=s(8423);class i{constructor(e){e.nodeType===Node.DOCUMENT_NODE?this.doc=e:(this.doc=e.shadowRoot,this.container=e),this.attachShadowListeners=[],this.patchAttachShadow(),this.onMutation=this._onMutation.bind(this),this.mutationObserver=new MutationObserver(this.onMutation),this.mutationObserver.observe(this.doc,{subtree:!0,childList:!0}),this.listeners=[],this.subMonitors=new Map,this.timeoutId=null,this._updateSubMonitors()}setupSubMonitors(){clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>{this._updateSubMonitors()}),0)}_updateSubMonitors(){[...this.subMonitors.keys()].filter((e=>!this.doc.contains(e))).forEach((e=>this.removeSubMonitor(e))),this.findAllContainers().forEach((e=>this.addSubMonitor(e)))}destroy(){clearTimeout(this.timeoutId),this.mutationObserver&&this.mutationObserver.disconnect(),this.mutationObserver=null;for(let e=0,t=this.listeners;ee.shadowRoot))}findMonitor(e){if(this.doc===e||this.doc.contains(e))return this;for(let t=0,s=this.subMonitors.values();t{t(e)}))}onAttachShadow(e){this.attachShadowListeners.push(e)}_onMutation(){this.setupSubMonitors()}getWindow(){return this.doc.nodeType===Node.DOCUMENT_NODE?this.doc.defaultView:this.container.ownerDocument.defaultView}patchAttachShadow(){if(this.getWindow().patchedAttachShadow)return;const e=Element.prototype.attachShadow,t=this;Element.prototype.attachShadow=function(s){const r=e.call(this,s);return s&&"open"===s.mode&&t.attachShadow(this),r},this.getWindow().patchedAttachShadow=!0}addSubMonitor(e){if(!this.subMonitors.has(e)){const t=new i(e);this.subMonitors.set(e,t);for(let e=0,s=this.listeners;er.event===e&&r.callback===t&&r.opt===s));r>=0&&this.listeners.splice(r,1),this.doc.removeEventListener(e,t,s);for(let r=0,i=this.subMonitors.values();r{e.O(0,[76],(()=>{return t=9880,e(e.s=t);var t}));var t=e.O(),s=CE2="undefined"==typeof CE2?{}:CE2;for(var r in t)s[r]=t[r];t.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})}]);